AEGetCoercionHandler
AEGetCoercionHandler Return handler for descriptor type coercion
#include <AppleEvents.h> Apple Event Manager
OSErr AEGetCoercionHandler ( fromType, toType, handler,
handlerRefcon, fromTypeIsDesc, isSysHandler );
DescType fromType ; descriptor type of coerced data
DescType toType ; descriptor type of resulting data
ProcPtr * handler ; pointer to coercion handler routine
long * handlerRefcon ; reference constant
Boolean * fromTypeIsDesc ; TRUE = data passed as descriptor record
FALSE = pointer to the data passed
Boolean isSysHandler ; TRUE = added to system coercion table
FALSE = added to application coercion table
returns Error Code; 0 = no error
The AEGetCoercionHandler function returns the handler for a specified
descriptor type coercion.
The fromType parameter is the descriptor type of the data coerced by the
handler, while the parameter toType is the descriptor type of the resulting
data.
The function returns a pointer to the coercion handler routine in the handler
parameter.
The function returns a reference constant in the handlerRefcon parameter.
The Apple Event Manager passes this reference constant to the handler each
time the handler is called.
If the function returns TRUE in the fromTypeIsDesc parameter, the coercion
handler expects the data to be passed as a descriptor record. If the function
returns FALSE, the coercion handler expects a pointer to the data.
The isSysHandler parameter specifies the coercion table from which to get the
handler. If its value is TRUE, the handler is taken from the
system coercion table. If its value is FALSE, the handler is taken from the
application coercion table.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAEHandlerNotFound (-1717) No coercion handler found